package com.itcast.quartz.job;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.Trigger;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

import static com.itcast.quartz.DateAndTimeUtils.dateConvertToLocalDateTime;

public class HelloJobSimpleTrigger implements Job {
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        //输出当前时间
        LocalDateTime date = LocalDateTime.now();
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        String dataStr = date.format(formatter);

        System.out.println("备份数据库的时间是：" + dataStr);
    }
}
